﻿@{Html.Telerik().PanelBar()
    .Name("LeftNavigationMenu")
    .HtmlAttributes(new { @class = "LeftNavigation" })
    .Items(items =>
    {
        items.Add().Text("主页").Action<HomeController>(c => c.Index());
        items.Add().Text("医院").Expanded(true).Items(subItems =>
        {
            subItems.Add().Text("医院管理").Action<HospitalController>(c => c.HospitalList());
            if(LoginSession.IsAdministrator)
                subItems.Add().Text("添加医院").Action<HospitalController>(c => c.HospitalAdd());
            if(!LoginSession.IsResearcher)
                subItems.Add().Text("管理用户").Action<HospitalController>(c => c.HospitalMemberManage(null));
            if (!LoginSession.IsResearcher)
                subItems.Add().Text("实验室标准").Action<LabCheckStdController>(c => c.LabCheckStdDetail((Guid)LoginSession.HospitalID));
        });
        items.Add().Text("病例报告").Expanded(true).Items(subItems =>
        {
            subItems.Add().Text("患者查询").Action<PatientController>(c => c.PatientListSelf());
            subItems.Add().Text("病例报告列表").Action<CRFController>(c => c.CRFList((Guid)LoginSession.HospitalID));
            subItems.Add().Text("添加新病例").Action<CRFController>(c => c.CRFAddSelf());
            //subItems.Add().Text("导出病例")/*TODO*/;
        });
        //items.Add().Text("消息系统");
        items.Add().Text("个人中心").Expanded(true).Items(subItems =>
        {
            subItems.Add().Text("个人信息").Action<MemberController>(c => c.MemberDetailSelf());
            subItems.Add().Text("修改个人信息").Action<MemberController>(c => c.MemberEditSelf());
            subItems.Add().Text("医院信息").Action<HospitalController>(c => c.HospitalDetail((Guid?)null));
            if (!LoginSession.IsResearcher)
                subItems.Add().Text("修改医院信息").Action<HospitalController>(c => c.HospitalEdit((Guid?)null));
            subItems.Add().Text("修改登录密码").Action<MemberController>(c => c.MemberChangePasswordSelf());
            subItems.Add().Text("注销登录").Action<MemberController>(c => c.Logout());
        });
        /*items.Add().Text("测试").Expanded(true).Items(subItems =>
        {
            subItems.Add().Text("测试页面").Action<TestController>(c => c.Index());
        });*/
    }).Render();
}
